//
//  IMMessageTableViewCell.h
//  MLIM
//
//  Created by molon on 15/6/25.
//  Copyright (c) 2015年 molon. All rights reserved.
//

#import <UIKit/UIKit.h>

@class IMMessage,IMMessageBackgroundImageView,IMUserAvatarImageView,IMUser;

#define kIMMessageCellBottomPadding 20.0f //cell底部间距

#define kAvatarImageViewSideLength 40.0f //头像的边长
#define kElementXSpacing 10.0f //各个元素之间X上的通用间距

//最小的cell高度，头像大小+底部间距
#define kMinMessageCellHeight (kAvatarImageViewSideLength+kIMMessageCellBottomPadding)

//日期的高度和Y方向的外边距
#define kDateLabelHeight 20.0f
#define kDateLabelYMargin 10.0f

//指示器的宽度和发送失败图标的边长
#define kIndicatorSideLength 20.0f
#define kSendFailedSignSideLength 20.0f

//背景图和cell宽度的最大比例
#define kMaxWidthRadioOfBackImageView (210.0f/320.0f)

@interface IMMessageTableViewCell : UITableViewCell

@property (nonatomic, strong) IMMessage *imMessage;

@property (readonly, nonatomic, strong) IMMessageBackgroundImageView *backgroundImageView;
@property (readonly, nonatomic, strong) IMUserAvatarImageView *avatarImageView;
@property (readonly, nonatomic, strong) UIActivityIndicatorView *indicator;
@property (readonly, nonatomic, strong) UIImageView *sendFailImageView;

@property (nonatomic, copy) void(^backgroundImageViewLongPressedBlock)(IMMessageTableViewCell *cell);
@property (nonatomic, copy) void(^backgroundImageViewTappedBlock)(IMMessageTableViewCell *cell);

@property (nonatomic, copy) void(^didTappedAvatarBlock)(IMUser *user);
@property (nonatomic, copy) void(^didClickLinkURLBlock)(NSURL *linkURL);

//继承
- (void)layoutEnd;
+ (CGFloat)heightOfMessage:(IMMessage*)imMessage maxWidth:(CGFloat)maxWidth;
- (void)resetWithIsInit:(BOOL)isInit;

- (void)changeBackgroundImageToDark:(BOOL)dark;

@end


//这个只是为了能很好的区分其他手势
@interface IMMessageTableViewCellLongPressGestureRecognizer : UILongPressGestureRecognizer

@end